﻿using System;
using System.Data;
using System.Linq;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    public partial class ITXEXRPT
    {

        private void JLTAV13AB05(DataSet db)
        {
            try
            {/*ORDERNO,ABJDATUM,ABJBENID,ART,ALLQTY,QTY订单号	小花号	订单投坯数	汇报数量	后整汇报日期	员工
*/
                DataTable dtSoruce = db.Tables["ABJOUR"];
                DataTable dtOutput = new DataTable();
                dtOutput.Columns.Add("ORDERNO", typeof(System.String));
                dtOutput.Columns.Add("ART", typeof(System.String));
                dtOutput.Columns.Add("ALLQTY", typeof(System.String));
                dtOutput.Columns.Add("QTY", typeof(System.String));
                dtOutput.Columns.Add("ABJDATUM", typeof(System.String));
                dtOutput.Columns.Add("ABJBENID", typeof(System.String));
                dtOutput.Merge(dtSoruce, false, MissingSchemaAction.Ignore);
                foreach (DataRow row in dtOutput.Rows)
                {
                    row["QTY"] = GetGB2312Value(row["QTY"].ToString());
                }
                exAgent.DataTableToExcel(dtOutput, 2, 1);

                int count = dtOutput.Rows.Count;
                exAgent.SetCellValue(1, 1, 1);
                exAgent.BatchConvert2Number(2, 3, count + 1, 4);
                exAgent.SetCellValue(1, 1, "订单号");

            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        }
        
    }
}